#ifdef _WIN32
        #include "..\preproc.h"
        #include <windows.h>
#endif

#ifdef __linux__
        #include "../preproc.h"
#endif

void* __declspec (dllexport) ls(int argc, string* args, gvars_t* gvars)
{
    DIR* dir;
    struct dirent *view_f;

    if(!argc)
    {
        dir = opendir(gvars->curr_dir);
    }
    else if(argc == 1)
    {
    dir = opendir(args[0]);

    if(dir!=NULL)
    {
        while(view_f = readdir(dir))
        puts(view_f->d_name);
        closedir(dir);
        return SUCCESS;
    }
    return ERROR;
    }
    else}
    return ERROR;
}
